cmake_minimum_required(VERSION 2.8)

###########################
## SET PROJECT VARIABLES ##
###########################

# If flex and bison are installed in ~/local the following lines are needed.
set(CMAKE_PREFIX_PATH  ${CMAKE_PREFIX_PATH}  "~/local")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "~/local/lib")
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "~/local/include"
                                             "${CMAKE_SOURCE_DIR}/cmake")

if("${CMAKE_BUILD_TYPE}" STREQUAL "")
  # Build type:
  # - None
  # - Debug
  # - Release
  # - RelWithDebInfo
  # - MinSizeRel
  set(CMAKE_BUILD_TYPE Debug)
endif()

message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

# Where the resulting files will spawn.
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin-${CMAKE_BUILD_TYPE}")
set(LIBRARY_OUTPUT_PATH    "${CMAKE_SOURCE_DIR}/lib-${CMAKE_BUILD_TYPE}")

option(BUILD_TESTS "Build the tests." ON)

include("cmake/config.cmake")

# The main include directory of the project.
include_directories("${CMAKE_SOURCE_DIR}/include")

# Add some global flags.
add_definitions(-std=gnu++11 -Wno-deprecated-declarations -Wall)

# Activate test generation.
enable_testing()

################################
## LOOK INTO SOURCE DIRECTORY ##
################################

add_subdirectory("src")
